using IM.Easy.Core.ServiceLifetime;
using IM.Easy.Core.Services;
using IM.Easy.Core.Utils;
using IM.Easy.Infrastructure.Query;
using IM.Easy.Entity.Msg;
using IM.Easy.MsgServices.Dtos;
using IM.Easy.Entity.System;

namespace IM.Easy.MsgServices.IServices
{
    public interface IEmailAccountService : IAppServices<EmailAccount>
    {

        /// <summary>
        /// 获取用户邮箱基本信息
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        EmailAccount GetAccount(long userId);


        /// <summary>
        /// 获取可用邮箱   只获取20条数据
        /// </summary>
        /// <param name="account"></param>
        /// <returns></returns>
        List<EmailAccountDto> GetAccountList(string account);


        /// <summary>
        /// 创建一个新实体
        /// </summary>
        /// <param name="entity">要创建的实体</param>
        /// <returns>创建后的实体</returns>
        EmailAccount Create(EmailAccount entity);

        /// <summary>
        /// 根据 ID 获取实体
        /// </summary>
        /// <param name="id">实体的唯一标识</param>
        /// <returns>获取的实体</returns>
        EmailAccount GetById(long id);

        /// <summary>
        /// 获取所有实体
        /// </summary>
        /// <returns>所有实体的列表</returns>
        PageResponse<EmailAccountDto> GetPageList(EmailAccountQueryDto query);

        /// <summary>
        /// 更新一个已有的实体
        /// </summary>
        /// <param name="entity">更新后的实体</param>
        /// <returns>更新后的实体</returns>
        bool Update(EmailAccount entity);

        /// <summary>
        /// 根据 ID 删除实体
        /// </summary>
        /// <param name="id">要删除的实体的唯一标识</param>
        /// <returns>操作是否成功</returns>
        bool Delete(params long[] key);

        /// <summary>
        /// 通过邮箱获取账号主体数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        List<SysUser> GetUser(params long[] id);
    }
}
